package com.openthinks.joyniproject.utils;

import java.io.IOException;
import java.util.Properties;

import org.apache.commons.lang.StringUtils;

public class Config {
	
    private static String rootPath = "";

	private static final Properties ps = new Properties();
	
    
	static {
		try {
			ps.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("util_config.properties"));
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
	
	public static String getProperty(String key) {
		
		String ret = ps.getProperty(key);
		if (StringUtils.isEmpty(ret)) {
			return ret;
		} else {
			return ret.trim();
		}
	}
	
	public static String getRootPath() {
		return rootPath;
	}

	public static void setRootPath(String rootPath) {
		Config.rootPath = rootPath;
	}
}
